<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			.a,.b{
				width: 100px;
				height: 100px;
			}
			.a{
				background-color: red;
				display: none;
			}
			.b{
				background-color: blue;
			}
		</style>
	</head>
	<body>
		
		<button id="btn-a">显示的隐藏/隐藏的显示</button>
		<div class="a">A</div>
		<div class="b">B</div>
		<script src="js/jquery.3.6.3.js"></script>
		<script>
			
			
			$("#btn-a").click(function(){
				//匹配所有不可见元素，或者type为hidden的元素
				
				let $divH = $("div:hidden");
				let $divV = $("div:visible");
				
				$divH.show();
				$divV.hide();
				
				// $("div:hidden").show();
				// $("div:visible").hide();
			})
		</script>
	</body>
</html>